<div class="pageheader">
            <h1 class="pagetitle">资料编辑</h1>
            <span class="pagedesc"></span>
        </div><!--pageheader-->
        
        <div id="contentwrapper" class="contentwrapper">
        	
        	<div id="basicform" class="subcontent">
                    
					<form class="stdform stdform2"  METHOD="POST" id="userinfo" enctype="multipart/form-data">
						<p>
							<label>头像</label>
							<span class="field"><img alt="" src="${request.contextPath}${admin.img_url}" onclick="findclick()" width="60px"></span>
						</p>
                    	<p>
                        	<label>用户名</label>
                            <span class="field"><input type="text" name="name" id="firstname2" class="longinput" value="${admin.name!''}"/></span>
                        </p>
                        
                        <p>
                        	<label>联系电话</label>
                            <span class="field"><input type="text" name="phone" id="lastname2" class="longinput"  value="${admin.phone!''}" /></span>
                        </p>

                        <p class="stdformbutton">
                        	<input name="id" type="hidden" value="${admin.id!''}"/>
                        	<input name="img" type="file" style="display:none"/>
                        	<button class="submit radius2">确定</button>
                        </p>
                    </form>
					
                    <br />

            </div><!--subcontent-->
<script type="text/javascript" src="${request.contextPath}/public/js/custom/forms.js"></script>
<script>
	function findclick(){
		jQuery("[name='img']").click()
	}
	
	function userinfo(){
	     var formData = new FormData(jQuery( "#userinfo" )[0]);  
	     jQuery.ajax({  
	          url: '${request.contextPath}/admin/userinfo' ,  
	          type: 'POST',  
	          data: formData,  
	          contentType: false,  
	          processData: false,  
	          success: function (returndata) {  
	              if(returndata=="saveerror"){
	              		alert("保存失败");
	              }else if(returndata=="success"){
	              	alert("保存成功");
	              }
	          },  
	          error: function (returndata) {  
	              alert(returndata);  
	          }  
	     });  
	}
</script>